import service from "@/utils/request"

import LoginWork from "@/utils/LoginWork"

// 成型生产线资料定义新增
export const MoldingLine = (parms:any) => {
    return LoginWork.put<any,any>(`/LastConfig/lineAdd`,parms)

}

// 生产线删除
export const deleteMethods = (workshopOld:string) => {
    return LoginWork.post<any,any>(`/LastConfig/lineDelete?workshop=${workshopOld}`)
}

// 查询
export const lineQuery = () => {
    return service.post<any,any>(`/LastConfig/LineQuery`)
}

// 排量查询
export const displacementQuery = (parms:any,displacementQueryParms1:any) => {
    console.log(displacementQueryParms1)
    return service.post<any,any>(`/LastConfig/percentQuery?line=${displacementQueryParms1.line}&time=${displacementQueryParms1.time}`,parms) 
}

// 排量删除
export const displacementDelete = (id:any) => {
    return LoginWork.get<any,any>(`/LastConfig/percentDelete?id=${id}`) 
}

// 排量新增
export const displacementAdd = (parms:any) => {
    return LoginWork.put<any,any>(`/LastConfig/percentAdd`,parms) 
}

// 节假日查询
export const holidayQuery = (parms:any) => {
    return service.post<any,any>(`/LastConfig/holidayQuery`,parms) 
}

// 产线查询
export const lineQuery1 = () => {
    return service.post<any,any>(`/LastConfig/LineQuery`) 
}

// 节假日新增
export const holidayAdd = (parms:any) => {
    return LoginWork.put<any,any>(`/LastConfig/holidayAdd`,parms)
}

// 节假日删除
export const holidayDelete = (id:any) => {
    return LoginWork.post<any,any>(`/LastConfig/holidayDelete?holidayDateOld=${id}`)
}

// 型体产能设定

// 型体产能设定查询
export const typeBodyQuery = (parms:any,parms1:any) => {
    return service.post<any,any>(`/LastConfig/ie/Query?type=${parms1.type}&brand=${parms1.brand}&style=${parms1.style}`,parms) 
}

// 批量删除
export const batchDelete = (parms:any) => {
    return LoginWork.post<any,any>(`/LastConfig/ie/delete`,parms) 
}

// 品牌和型体更新
export const update = (parms:any) => {
    return LoginWork.get<any,any>(`/LastConfig/ie/styleUp?brand=${parms.brand}&type=${parms.type}`) 
}

// 品牌查询
export const brandQuery = () => {
    return service.get<any,any>(`/LastConfig/ie/back/brand?search=${''}`) 
}


// 时段门槛定义
export const typeBodyQuery1 = (parms:any,parms1:any) => {
    return service.post<any,any>(`/LastConfig/time/Query?type=${parms1.type}&brand=${parms1.brand}&style=${parms1.style}`,parms) 
}

// 批量删除
export const batchDelete1 = (parms:any) => {
    return LoginWork.post<any,any>(`/LastConfig/time/delete`,parms) 
}

// 品牌和型体更新
export const update1 = (parms:any) => {
    return LoginWork.get<any,any>(`/LastConfig/time/styleUp?brand=${parms.brand}&type=${parms.type}`) 
}

// 品牌查询
export const brandQuery1 = () => {
    return service.get<any,any>(`/LastConfig/lt/back/brand?search=${''}`) 
}

// 插入月份
export const insertMonth = (parms:any) => {
    return LoginWork.put<any,any>(`/LastConfig/percent/add/month?month=${parms}`) 
}